var images = $('.banner .img_lst img');
var yd = $('.banner .yd a');
var currentIndex = 0;
var currentDot = 0;
var interval = setInterval(changeImage, 3000);

$(document).ready(function() {
    images.on('mouseenter', function() {
        clearInterval(interval); // 鼠标悬浮时停止轮播
    }).on('mouseleave', function() {
        interval = setInterval(changeImage, 3000); // 鼠标离开时恢复轮播
    });
});
function changeImage() {
    images.eq(currentIndex).removeClass('active'); // 移除当前图片的active类
    yd.eq(currentDot).removeClass('active');
    currentDot = (currentDot + 1) % yd.length;
    currentIndex = (currentIndex + 1) % images.length; // 计算下一张图片的索引
    images.eq(currentIndex).addClass('active'); // 给下一张图片添加active类
    yd.eq(currentDot).addClass('active');
}